package service;

import pojo.Comments;

import java.sql.SQLException;
import java.util.ArrayList;

public interface CommentsService {
    /**
     * 获取数据库某用户likes表数据
     *
     * @param nid
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Comments> findCommentByNid(Integer nid) throws SQLException, ClassNotFoundException;

    /**
     * 发布一级评论
     *
     * @param comments
     * @return
     * @throws SQLException
     */
    boolean addComment1(Comments comments) throws SQLException;

    /**
     * 删除评论
     *
     * @param cid
     * @return
     * @throws SQLException
     */
    boolean userDeleteComment(Integer cid) throws SQLException;

    /**
     * 根据cid找到具体某条评论
     *
     * @param cid
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    Comments findCommentByCid(Integer cid) throws SQLException, ClassNotFoundException;
}
